﻿<UserControl
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ignore="http://www.ignore.com" 
        x:Class="EcoProIT.UserControles.Products"
        mc:Ignorable="d ignore"
        >

    <StackPanel>
       
        <Label Content="Products"/>
        <ListBox x:Name="_listBox" 
                           ItemsSource="{Binding ProductList}" 
                           SelectedItem="{Binding SelectedProduct}"
                 ItemContainerStyle="{DynamicResource myLBStyle}"
                 >
            <ListBox.Resources>
                <Style x:Key="myLBStyle" TargetType="{x:Type ListBoxItem}">
                    <EventSetter Event="PreviewGotKeyboardFocus" Handler="SelectCurrentItem"/>
                    <!--<EventSetter Event="MouseUp" Handler="CurrentItemClick"/>-->
                    <Style.Resources>
                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
                             Color="SteelBlue"/>
                        <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}"
                             Color="SteelBlue"/>
                        
                    </Style.Resources>
                </Style>

            </ListBox.Resources>


                </ListBox>
    </StackPanel>
</UserControl>